home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15112 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: mudskipper.cac.psu.edu!user
  2. From: fcusack@tdx.org (frank.)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Question about C compiler
  5. Date: Wed, 17 Apr 1996 05:22:19 -0400
  6. Organization: Soylent Green is People!!
  7. Message-ID: <fcusack-1704960522190001@mudskipper.cac.psu.edu>
  8. References: <1996Apr16.175344.6042@lafn.org>
  9. NNTP-Posting-Host: mudskipper.cac.psu.edu
  10.  
  11. In article <1996Apr16.175344.6042@lafn.org>, av871@lafn.org (Karl Chen) wrote:
  12.  
  13. >     In C and C++ ,there is a way to allocate and dealloacte memory 
  14. > dynamically ( in C,using malloc() and free(),In C++,using new and delete)
  15.  
  16. You just answered it yourself! That's exactly how you do it.
  17.  
  18. > .I heard from a book that some compiler do not delete the pointer after
  19. > deallocation,is this true?Why they don't do this ? What about Boland C++
  20. > ? Can anyone give me a advice ?
  21.  
  22. not true. After you call free/delete, the pointer is no longer valid, and
  23. the memory has been freed for later use (although not necessarily freed to
  24. the OS)
  25.  
  26. ~Frank
  27.  - Through the modem, past the router, over the firewall.. nothing but Net -
  28.  -  PGP ID: 1C0F6685 | NCB#56 | Visit me --> http://www.tdx.org/~fcusack/  -
  29.